package com.ruoyi.project.cms.knowledgemanagement.controller;


import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.cms.knowledgemanagement.domain.KnowledgeSoft;
import com.ruoyi.project.cms.knowledgemanagement.service.IKnowledgeBenchmarkingService;
import com.ruoyi.project.cms.knowledgemanagement.service.IKnowledgeSoftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/knowledgemanagement/knowledgeSoft")
public class KnowledgeSoftController  extends BaseController {
    @Autowired
    private IKnowledgeSoftService iKnowledgeSoftService;
    @Autowired
    private IKnowledgeBenchmarkingService iKnowledgeBenchmarkingService;


    String prefix="/cms/knowledgemanagement";

    @GetMapping("")
    public String knowledge(){
        return prefix+"/soft";
    }

    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo selectOne(KnowledgeSoft knowledgeSoft){
        List<KnowledgeSoft> list = iKnowledgeSoftService.selectOneKnowledgeSoft(knowledgeSoft);

        return getDataTable(list);
    }


    @GetMapping("/edit")
    public String edit(){
        return prefix+"/edit";
    }

    /*
     * 查看
     * */
    @GetMapping("/detail/{project_id}")
    public String detail(@PathVariable("project_id") Long project_id, ModelMap map){
        map.put("KnowledgeBenchmarking",iKnowledgeBenchmarkingService.selectOneByID(project_id));
        return prefix+"/detail";
    }

}
